package com.controller;

import com.bean.Bumen;
import com.service.BumenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.List;

@RestController
@RequestMapping("/consumer")
public class BumenController_Feign_Consumer {
    @Autowired
    private BumenService bumenService;
    /*private static final String REST_URL="http://localhost:8001";*/
     private static final String REST_URL="http://microservicecloud-bumen";

    @RequestMapping(path = "/bumen/addbumen")
    public boolean addBumen(Bumen bumen){
      return bumenService.addBumen(bumen);
    }
    @RequestMapping(path = "/bumen/list")
    public List<Bumen> getAll(){
        return bumenService.getAll();
    }
    @RequestMapping(path = "/bumen/getbumenbyid/{id}")
     public Bumen getBumenById(@PathVariable("id")Integer id ){
        return bumenService.getBumenById(id);
    }

}
